﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<!--[if IE 8 ]>
<html class="ie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"><!--<![endif]-->
<head>
    <!-- Basic Page Needs -->
    <meta charset="UTF-8">
    <!--[if IE]>
    <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->
    <title>Techno Store - Shop Cart</title>

    <meta name="author" content="CreativeLayers">

    <!-- Mobile Specific Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <!-- Boostrap style -->
    <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.min.css">

    <!-- Theme style -->
    <link rel="stylesheet" type="text/css" href="/stylesheets/style.css">

    <!-- Reponsive -->
    <link rel="stylesheet" type="text/css" href="/stylesheets/responsive.css">

    <link rel="shortcut icon" href="/favicon/favicon.png">

</head>
<body class="header_sticky">
<div class="boxed">

    <div class="overlay"></div>

    <!-- Preloader -->
    <div class="preloader">
        <div class="clear-loading loading-effect-2">
            <span></span>
        </div>
    </div><!-- /.preloader -->


    <div th:insert="~{header :: #header}"></div>

    <section class="flat-breadcrumb">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <ul class="breadcrumbs">
                        <li class="trail-item">
                            <a href="/page/index" title="">首页</a>
                            <span><img src="/images/icons/arrow-right.png" alt=""></span>
                        </li>
                        <li class="trail-item">
                            <a href="/page/food" title="">商店</a>
                            <span><img src="/images/icons/arrow-right.png" alt=""></span>
                        </li>
                        <li class="trail-end">
                            <a href="/user/info" title="">我的基本信息</a>
                        </li>
                    </ul><!-- /.breacrumbs -->
                </div><!-- /.col-md-12 -->
            </div><!-- /.row -->
        </div><!-- /.container -->
    </section><!-- /.flat-breadcrumb -->

    <section class="flat-shop-cart">
        <div class="container">
            <div class="row">
                <div class="col-lg-4">
                    <div class="cart-totals">
                        <h3><font style="vertical-align: inherit;"><font
                                style="vertical-align: inherit;">我的基本信息</font></font></h3>
                        <form action="#" method="get" accept-charset="utf-8">
                            <table>
                                <tbody>
                                <tr>
                                    <td>邮箱</td>
                                    <td class="subtotal" th:text="${userInfo.email}"></td>
                                </tr>

                                <tr>
                                    <td>剩余保证金</td>
                                    <td class="price-total"
                                        th:text="${#numbers.formatCurrency(userInfo.money)} + '元'"></td>
                                </tr>

                                <tr>
                                    <td>用户状态</td>
                                    <td class="subtotal" th:if="${userInfo.status == 1} "> 正常用户</td>
                                    <td class="subtotal" th:if="${userInfo.status == 2} "> 错误用户</td>
                                </tr>

                                <tr>
                                    <td>类型</td>
                                    <td class="subtotal" th:if="${userInfo.type == 1} "> 普通用户</td>
                                    <td class="subtotal" th:if="${userInfo.type == 2} "> 管理用户</td>
                                </tr>


                                </tbody>

                            </table>
                            <div class="btn-cart-totals">
                                <!--<a href="#" class="update" title="">更新购物车</a>-->
                                <a onclick="addTraining()" class="checkout" title="">添加我的代练</a>
                            </div><!-- /.btn-cart-totals -->
                        </form><!-- /form -->
                    </div><!-- /.cart-totals -->
                </div><!-- /.col-lg-4 -->
                <div id="aboutMy" class="col-lg-8">
                    <div class="flat-row-title style1">
                        <h3>我的代练</h3>
                    </div>
                    <div class="table-cart mCustomScrollbar _mCS_1 mCS_no_scrollbar">
                        <div id="mCSB_1" class="mCustomScrollBox mCS-light mCSB_horizontal mCSB_inside"
                             style="max-height: none;" tabindex="0">
                            <div id="mCSB_1_container" class="mCSB_container mCS_x_hidden mCS_no_scrollbar_x"
                                 style="position: relative; top: 0px; left: 0px; width: 499px; min-width: 100%; overflow-x: inherit;"
                                 dir="ltr">
                                <table>
                                    <thead>
                                    <tr>
                                        <th>产品标题</th>
                                        <th>卖家账号</th>
                                        <th>保证金</th>
                                        <th>状态</th>
                                        <th>期限</th>
                                        <th>创建日期</th>
                                    </tr>
                                    </thead>
                                    <tbody id="cart">
                                    <tr th:each="training:${pageInfo.list}">
                                        <td style="width: 20%!important; padding: 0 0 0 0">
                                            <div class="name-product" th:text="${training.title}"></div>
                                        </td>
                                        <td style="width: 20%!important; padding: 0 0 0 0">
                                            <div class="name-product" th:text="${training.saleInfo}"></div>
                                        </td>
                                        <td style="width: 12%!important; padding: 0 0 0 0">
                                            <div class="name-product"  th:text="${training.contentMoney} + '元'"></div>
                                        </td>

                                        <td style="padding: 0 0 0 0">
                                            <div class="name-product" th:if="${training.contentStatus == 1}">待审核</div>
                                            <div class="name-product" th:if="${training.contentStatus == 200}">审核完成</div>
                                            <div class="name-product" th:if="${training.contentStatus == 300}">已被接单</div>
                                            <div class="name-product" th:if="${training.contentStatus == 400}">审核失败</div>
                                        </td>

                                        <td style="width: 21%!important; padding: 0 0 0 0">
                                            <div class="name-product"  th:text="${training.limt}"></div>
                                        </td>

                                        <td style=" padding: 0 0 0 0">
                                            <div class="name-product" th:text="${#dates.format(training.createTime,'yyyy-MM-dd HH:mm')}"></div>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>

                            </div>

                        </div>
                    </div><!-- /.table-cart -->

                    <div class="flat-row-title style1">
                        <h3>我的发布</h3>
                    </div>
                    <div class="table-cart mCustomScrollbar _mCS_1 mCS_no_scrollbar">
                        <div class="mCustomScrollBox mCS-light mCSB_horizontal mCSB_inside"
                             style="max-height: none;" tabindex="0">
                            <div class="mCSB_container mCS_x_hidden mCS_no_scrollbar_x"
                                 style="position: relative; top: 0px; left: 0px; width: 499px; min-width: 100%; overflow-x: inherit;"
                                 dir="ltr">
                                <table>
                                    <thead>
                                    <tr>
                                        <th>标题</th>
                                        <th>内容</th>
                                        <th>保证金</th>
                                        <th>状态</th>
                                        <th>创建时间</th>
                                        <th>更新时间</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                        <tr th:each="content:${contentPageInfo.list}">
                                            <td style="width: 20%!important; padding: 0 0 0 0">
                                                <div class="name-product" th:text="${content.title}"></div>
                                            </td>
                                            <td style="width: 20%!important; padding: 0 0 0 0">
                                                <div class="name-product" th:text="${content.content}"></div>
                                            </td>
                                            <td style="width: 12%!important; padding: 0 0 0 0">
                                                <div class="name-product"  th:text="${content.money} + '元'"></div>
                                            </td>

                                            <td style="padding: 0 0 0 0">
                                                <div class="name-product" th:if="${content.status == 1}">待审核</div>
                                                <div class="name-product" th:if="${content.status == 200}">审核完成</div>
                                                <div class="name-product" th:if="${content.status == 300}">已被接单</div>
                                                <div class="name-product" th:if="${content.status == 400}">审核失败</div>

                                            </td>
                                            <td style=" padding: 0 0 0 0">
                                                <div class="name-product" th:text="${#dates.format(content.updateTime,'yyyy-MM-dd HH:mm')}"></div>
                                            </td>
                                            <td style=" padding: 0 0 0 0">
                                                <div class="name-product" th:text="${#dates.format(content.updateTime,'yyyy-MM-dd HH:mm')}"></div>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>

                </div><!-- /.col-lg-8 -->

                <div id="addMyTraining" style="display: none;" class="col-lg-8">
                    <div class="form-register">

                        <form onsubmit="return false" id="form-submit" accept-charset="utf-8">
                            <div class="form-box">
                                <label for="name-register">请输入标题： </label>
                                <input type="text" id="name-register" placeholder="例：英雄联盟等级代练" name="title">
                                <span id="error"></span>
                            </div><!-- /.form-box -->
                            <div class="form-box">
                                <label for="password-register">请输入内容：</label>
                                <input type="text" id="password-register" placeholder="例：50元求代练三级" name="content">

                            </div><!-- /.form-box -->
                            <div class="form-box">
                                <label for="password-register">请输入期限：</label>
                                <input type="text" placeholder="例：一个月内完成" name="limt">

                            </div><!-- /.form-box -->


                            <div class="form-box">
                                <label for="password-register">请输入需要保证金额：</label>
                                <input type="text" placeholder="例：100元" name="money">
                            </div><!-- /.form-box -->
                            <div class="form-box">
                                <button type="submit" onclick="submitTraining()" class="register">提交</button>
                            </div><!-- /.form-box -->
                        </form><!-- /#form-register -->
                    </div><!-- /.form-register -->
                </div><!-- /.col-lg-8 -->

            </div>
        </div><!-- /.container -->
    </section>

    <section class="flat-row flat-iconbox style3">
        <div class="container">
            <div class="row">
                <div class="col-lg-3 col-md-6">
                    <div class="iconbox style1">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/car.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3>Worldwide Shipping</h3>
                            </div>
                            <div class="clearfix"></div>
                        </div><!-- /.box-header -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-lg-3 col-md-6 -->
                <div class="col-lg-3 col-md-6">
                    <div class="iconbox style1">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/order.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3>Order Online Service</h3>
                            </div>
                            <div class="clearfix"></div>
                        </div><!-- /.box-header -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-lg-3 col-md-6 -->
                <div class="col-lg-3 col-md-6">
                    <div class="iconbox style1">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/payment.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3>Payment</h3>
                            </div>
                            <div class="clearfix"></div>
                        </div><!-- /.box-header -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-lg-3 col-md-6 -->
                <div class="col-lg-3 col-md-6">
                    <div class="iconbox style1">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/return.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3>Return 30 Days</h3>
                            </div>
                            <div class="clearfix"></div>
                        </div><!-- /.box-header -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-lg-3 col-md-6 -->
            </div><!-- /.row -->
        </div><!-- /.container -->
    </section><!-- /.flat-iconbox -->
    <section class="flat-iconbox">
        <div class="container">
            <div class="row">
                <div class="col-md-3">
                    <div class="iconbox">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/car.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3><font style="vertical-align: inherit;"><font
                                        style="vertical-align: inherit;">全球送货</font></font></h3>
                            </div>
                        </div><!-- /.box-header -->
                        <div class="box-content">
                            <p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">订单满$
                                100免运费</font></font></p>
                        </div><!-- /.box-content -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-md-3 -->
                <div class="col-md-3">
                    <div class="iconbox">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/order.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3><font style="vertical-align: inherit;"><font
                                        style="vertical-align: inherit;">在线订购服务</font></font></h3>
                            </div>
                        </div><!-- /.box-header -->
                        <div class="box-content">
                            <p><font style="vertical-align: inherit;"><font
                                    style="vertical-align: inherit;">30天内免费退货</font></font></p>
                        </div><!-- /.box-content -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-md-3 -->
                <div class="col-md-3">
                    <div class="iconbox">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/payment.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3><font style="vertical-align: inherit;"><font
                                        style="vertical-align: inherit;">付款</font></font></h3>
                            </div>
                        </div><!-- /.box-header -->
                        <div class="box-content">
                            <p><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">安全系统</font></font>
                            </p>
                        </div><!-- /.box-content -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-md-3 -->
                <div class="col-md-3">
                    <div class="iconbox">
                        <div class="box-header">
                            <div class="image">
                                <img src="/images/icons/return.png" alt="">
                            </div>
                            <div class="box-title">
                                <h3><font style="vertical-align: inherit;"><font
                                        style="vertical-align: inherit;">返回30天</font></font></h3>
                            </div>
                        </div><!-- /.box-header -->
                        <div class="box-content">
                            <p><font style="vertical-align: inherit;"><font
                                    style="vertical-align: inherit;">30天内免费退货</font></font></p>
                        </div><!-- /.box-content -->
                    </div><!-- /.iconbox -->
                </div><!-- /.col-md-3 -->
            </div><!-- /.row -->
        </div><!-- /.container -->
    </section>
    <div th:insert="~{footer :: #footer}"></div>

    <section class="footer-bottom">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <p class="copyright"> All Rights Reserved © Techno Store 2017</p>
                    <p class="btn-scroll">
                        <a href="#" title="">
                            <img src="/images/icons/top.png" alt="">
                        </a>
                    </p>
                </div><!-- /.col-md-12 -->
            </div><!-- /.row -->
        </div><!-- /.container -->
    </section><!-- /.footer-bottom -->

</div><!-- /.boxed -->

<!-- Javascript -->
<script type="text/javascript" src="/javascript/jquery.min.js"></script>
<script type="text/javascript" src="/javascript/tether.min.js"></script>
<script type="text/javascript" src="/javascript/bootstrap.min.js"></script>
<script type="text/javascript" src="/javascript/waypoints.min.js"></script>
<script type="text/javascript" src="/javascript/jquery.circlechart.js"></script>
<script type="text/javascript" src="/javascript/easing.js"></script>
<script type="text/javascript" src="/javascript/jquery.flexslider-min.js"></script>
<script type="text/javascript" src="/javascript/owl.carousel.js"></script>
<script type="text/javascript" src="/javascript/smoothscroll.js"></script>
<script type="text/javascript" src="/javascript/jquery-ui.js"></script>
<script type="text/javascript" src="/javascript/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="/javascript/gmap3.min.js"></script>
<script type="text/javascript" src="/javascript/waves.min.js"></script>
<script type="text/javascript" src="/javascript/jquery.countdown.js"></script>
<script type="text/javascript" src="/javascript/main.js"></script>
</body>
</html>
<script type="text/javascript">
    function addTraining() {
        $("#aboutMy").css('display', 'none');
        $("#addMyTraining").css('display', 'block');
    }

    function submitTraining() {
        $.ajax({
            url: '/user/addTraining',
            dataType: 'JSON',
            type: 'POST',
            data: $("#form-submit").serialize(),
            success: function (result) {
                if (result.code == 200) {
                    alert(result.msg)
                    window.location.reload();
                } else {
                    alert(result.msg);
                    return false;
                }
            }
        })
    }


</script>